Chart for WPF and Silverlight > Getting Started > Quick Start > Step 4 of 4: Adjust the Chart's Appearance |
In this last step, you will adjust the chart's appearance using the Theme property.
To set the chart’s theme in Visual Studio using XAML:
To specifically define the Office2007Blue theme in your chart, add the following Theme markup to the <c1chart:C1Chart> tag so that it appears similar to the following:
XAML |
Copy Code
|
---|---|
<c1chart:C1Chart Margin="0,0,8,8" MinHeight="160" MinWidth="240" Content="C1Chart" ChartType="Bar" Theme="Office2007Blue"> |
To set the chart's theme in Visual Studio in code:
Visual Basic |
Copy Code
|
---|---|
C1Chart1.Theme = TryCast(C1Chart1.TryFindResource(New ComponentResourceKey(GetType(C1Chart), "Office2007Blue")), ResourceDictionary)
|
C# |
Copy Code
|
---|---|
C1Chart1.Theme = c1Chart1.TryFindResource( new ComponentResourceKey(typeof(C1.WPF.C1Chart.C1Chart), "Office2007Blue")) as ResourceDictionary; |
Visual Basic |
Copy Code
|
---|---|
c1Chart1.Theme = ChartTheme. |
C# |
Copy Code
|
---|---|
c1Chart1.Theme = ChartTheme.Office2007Blue; |
What You've Accomplished:
The Office 2007 Blue theme is applied to the C1Chart control.
Congratulations! You've completed the Chart for WPF quick start and created a chart application, added data to the chart, set the axes bounds, formatted the axes annotation, and customized the appearance of the chart.